<template>
    <div class="phone">
        <div class="phone_bg1">
            <div class="phone_bg2">
                <div class="phone_bg3 pos_r">
                    <div class="phone_lh">
                        <div class="phone_lh_con">
                            <div class="lh_tiao"></div>
                            <div class="lh_yuan"></div>
                        </div>
                    </div>
                    <span class="date_time">{{time}}</span>
                    <div class="states">
                        <img src="../../static/iphone/信号.png" />
                        <img class="margin_lr_5" src="../../static/iphone/wifi.png" />
                        <img src="../../static/iphone/电量.png" />
                    </div>
                    <div class="phone-container">
                        <iframe :src="url"></iframe>
                    </div>
                    <div class="phone_home"></div>
                </div>
            </div>
        </div>
        <div class="jingyin"></div>
        <div class="yl_jia"></div>
        <div class="yl_jian"></div>
        <div class="suoping"></div>
    </div>
</template>

<script>
export default {
    props: {
        url: {
            type: String,
            default: ""
        }
    },
    data() {
        return {
            time: ""
        };
    },
    methods: {
        twoDigits(val) {
            if (val < 10) return "0" + val;
            return val;
        }
    },
    mounted() {
        setInterval(() => {
            var today = new Date();
            this.time =
                this.twoDigits(today.getHours()) +
                ":" +
                this.twoDigits(today.getMinutes());
        }, 1000);
    }
};
</script>

<style scoped>
.phone {
    margin: 0px auto;
    width: 400px;
    height: 800px;
    background: #68686b;
    border-radius: 30px;
    box-sizing: border-box;
    padding: 2px;
    position: relative;
}
.phone:after {
    position: absolute;
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    top: 10px;
    left: 10px;
    z-index: -1;
    border-radius: 18px;
    filter: blur(8px);
}
.phone_bg1 {
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 30px;
    box-sizing: border-box;
    padding: 0.5px;
}
.phone_bg2 {
    width: 100%;
    height: 100%;
    background: #0b0d0c;
    border-radius: 30px;
    box-sizing: border-box;
    padding: 10px;
    box-shadow: inset 14px 0px 10px -15px #fff, inset -14px 0px 10px -15px #fff;
}
.phone_bg3 {
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 26px;
    box-sizing: border-box;
    position: relative;
}
.phone_lh {
    width: 50%;
    height: 20px;
    background: #0b0d0c;
    margin: 0 auto;
    border-radius: 0px 0px 14px 14px;
    position: relative;
}
.phone_lh_con {
    display: flex;
    align-items: center;
    justify-content: center;
}
.phone_lh:before {
    position: absolute;
    content: "";
    width: 5px;
    height: 5px;
    background: #0b0d0c;
    left: -5px;
    top: 0px;
    z-index: 9;
}
.phone_lh:after {
    position: absolute;
    content: "";
    width: 5px;
    height: 5px;
    background: #0b0d0c;
    right: -5px;
    top: 0px;
    z-index: 9;
}
.phone_lh_con:before {
    position: absolute;
    content: "";
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 100%;
    left: -10px;
    top: 0px;
    z-index: 10;
}
.phone_lh_con:after {
    position: absolute;
    content: "";
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 100%;
    right: -10px;
    top: 0px;
    z-index: 10;
}
.lh_tiao {
    width: 25%;
    height: 3px;
    border-radius: 5em;
    background: #2d2d2d;
    margin-left: 8px;
    margin-top: 4px;
}
.lh_yuan {
    width: 5px;
    height: 5px;
    border-radius: 5em;
    background: #212554;
    margin-left: 8px;
    margin-top: 4px;
}
.phone_home {
    width: 32%;
    height: 0.5%;
    border-radius: 5em;
    position: absolute;
    bottom: 1%;
    left: 50%;
    margin-left: -16%;
    background: #0b0d0c;
}
.phone_bg3 #text {
    font-size: 18px;
    position: absolute;
    top: 20%;
    left: 0%;
    text-align: center;
    width: 100%;
    font-weight: 600;
}
.phone_bg3 .a_user {
    font-size: 10px;
    font-weight: bold;
    position: absolute;
    bottom: 10%;
    left: 50%;
    text-align: center;
    width: 64px;
    margin-left: -32px;
    background: #06f;
    color: #fff;
    border-radius: 5em;
    line-height: 1.5em;
    padding: 3px 0px;
    cursor: pointer;
    transition: all 0.8s ease;
}
.phone_bg3 .date_time {
    width: 25%;
    left: 0px;
    position: absolute;
    top: 6px;
    z-index: 111;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}
.states {
    width: 25%;
    right: 1.5px;
    position: absolute;
    top: 4px;
    z-index: 111;
    display: flex;
    align-items: center;
    justify-content: center;
}
.states img {
    width: 20px;
}

.phone-container {
    position: absolute;
    top: 24px;
    left: 0;
    right: 0;
    bottom: 24px;
}
.phone-container iframe {
    border: 0 none;
    width: 100%;
    height: 100%;
    overflow: auto;
    display: block;
}
.jingyin {
    width: 1.5px;
    height: 3.75%;
    background: #121212;
    position: absolute;
    top: 13.5%;
    left: -1.5px;
    border-radius: 5px 0px 0px 5px;
}
.jingyin:after {
    content: "";
    display: block;
    width: 0.8px;
    height: 90%;
    background: rgba(255, 255, 255, 0.8);
    position: absolute;
    left: 0px;
    bottom: 5%;
}
.yl_jia {
    width: 1.5px;
    height: 7%;
    background: #121212;
    position: absolute;
    top: 20.75%;
    left: -1.5px;
    border-radius: 5px 0px 0px 5px;
}
.yl_jia:after {
    content: "";
    display: block;
    width: 0.5px;
    height: 90%;
    background: rgba(255, 255, 255, 0.6);
    position: absolute;
    right: 0px;
    bottom: 5%;
}
.yl_jian {
    width: 1.5px;
    height: 7%;
    background: #121212;
    position: absolute;
    top: 30%;
    left: -1.5px;
    border-radius: 5px 0px 0px 5px;
}
.yl_jian:after {
    content: "";
    display: block;
    width: 0.5px;
    height: 90%;
    background: rgba(255, 255, 255, 0.6);
    position: absolute;
    right: 0px;
    bottom: 5%;
}
.suoping {
    width: 1.5px;
    height: 11.5%;
    background: #121212;
    position: absolute;
    top: 23%;
    right: -1.5px;
    border-radius: 0px 5px 5px 0px;
}
.suoping:after {
    content: "";
    display: block;
    width: 0.5px;
    height: 90%;
    background: rgba(255, 255, 255, 0.6);
    position: absolute;
    left: 0px;
    bottom: 5%;
}
</style>
